#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
# @FileName  :jobs.py
# @Time      :2022/4/21 2:46 PM
# @Author    :Toliong toliong@foxmail.com
"""
from sqlalchemy import Column, Integer, String, Boolean, Date, ForeignKey
from sqlalchemy.orm import relationship

from db.base_class import Base
from core.config import lg


class Job(Base):
    id = Column(Integer, primary_key=True, index=True)
    title = Column(String, nullable=False)
    company = Column(String, nullable=False)
    company_url = Column(String)
    location = Column(String, nullable=False)
    description = Column(String, nullable=False)
    date_posted = Column(Date)
    is_active = Column(Boolean(), default=True)
    owner_id = Column(Integer, ForeignKey("user.id"))
    owner = relationship("User", back_populates="jobs")


if __name__ == "__main__":
    pass
